package com.fdb.efp.cus.service.impl;

import com.fdb.efp.cus.service.dao.CusIndivOccTempDao;
import com.fdb.efp.cus.service.domain.CusIndivOccTemp;
import com.fdb.basic.framework.core.base.FrameworkService;
import com.fdb.efp.cus.service.facade.CusIndivOccTempService;
import com.fdb.efp.cus.service.vo.CusIndivOccTempVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 需求编号:2020D05--
 * 问题编号:
 * 开发人员: wengqw
 * 创建日期:2020/9/9
 * 功能描述:
 * 修改日期:2020/9/9
 * 修改描述:
 */
@Service("cusIndivOccTempService")
public class CusIndivOccTempServiceImpl implements CusIndivOccTempService, FrameworkService {

    private static Logger logger = LoggerFactory.getLogger(CusIndivOccTempServiceImpl.class);

    @Autowired
    private CusIndivOccTempDao cusIndivOccTempDao;

    @Override
    public int updateByPk(CusIndivOccTempVo cusIndivOccTempVo) {
        logger.info("当前修改数据为:" + cusIndivOccTempVo.toString());
        int num;
        try {
            CusIndivOccTemp cusIndivOccTemp = new CusIndivOccTemp();
            beanCopy(cusIndivOccTempVo,cusIndivOccTemp);
            num = cusIndivOccTempDao.updateByPk(cusIndivOccTemp);
        }catch (Exception e){
            logger.error("修改数据发生异常！" + e);
            num = -1;
        }
        logger.info("根据条件:" + cusIndivOccTempVo + "修改的数据条数为" + num);
        return num;
    }
}
